package me.zhengjie.modules.customer.service;

import me.zhengjie.modules.customer.domain.TCustomerInfo;
import me.zhengjie.modules.customer.service.dto.TCustomerInfoDTO;
import me.zhengjie.modules.customer.service.dto.TCustomerInfoQueryCriteria;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

/**
* @author xuyukun
* @date 2019-07-21
*/
@CacheConfig(cacheNames = "tCustomerInfo")
public interface TCustomerInfoService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(TCustomerInfoQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(TCustomerInfoQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
   // @Cacheable(key = "#p0")
    TCustomerInfoDTO findById(Long id);

    /**
     * create
     * @param resources
     * @return
     */
    //@CacheEvict(allEntries = true)
    TCustomerInfoDTO create(TCustomerInfo resources);

    /**
     * update
     * @param resources
     */
    //@CacheEvict(allEntries = true)
    void update(TCustomerInfo resources);

    /**
     * delete
     * @param id
     */
   // @CacheEvict(allEntries = true)
    void delete(Long id);

    //根据编码或名字查询客户
    public Object queryByCodeOrName(String value);
}